package com.catazy.mvvmlib.base.activity

import android.view.LayoutInflater
import android.view.View
import androidx.databinding.ViewDataBinding
import androidx.viewbinding.ViewBinding
import com.catazy.mvvmlib.base.viewmodel.BaseViewModel
import com.catazy.mvvmlib.ext.inflateBindingWithGeneric
import java.lang.reflect.ParameterizedType

/**
 * 作者: Tao
 * 日期: 2024/1/25
 * 时间: 9:36
 * 描述:
 */
abstract class BaseVmDbActivity<VM : BaseViewModel, DB : ViewDataBinding> : BaseVmActivity<VM>() {

    lateinit var mDatabind: DB

    /**
     * 当使用ViewBinding模式时，这里直接不传布局
     */
    override fun layoutId(): Int {
        return 0
    }

    /**
     * 创建View
     */
    override fun initDataBind(): View? {
        mDatabind = inflateBindingWithGeneric()
        return mDatabind.root
    }
}